﻿using Orleans.Concurrency;
using Orleans;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
    public interface IMarkerSet : IGrainWithIntegerKey
    {
        Task 重置数据( );

        [AlwaysInterleave]
        public Task<MarkerInfo?> 获取地标(int x, int y);

        [AlwaysInterleave]
        public Task<string> 获取对应传输机台(string MarkerID);

        [AlwaysInterleave]
        public Task<string> 获取对应地标号(string DeviceID);




        [AlwaysInterleave]
        public Task<MarkerInfo?> 获取指定地标(string MarkerID);


         
    }

    #region 数据定义


    [Serializable]
    public class MarkerInfo
    {
        public string MarkerID { get; set; } = "";
        public int X { get; set; }
        public int Y { get; set; }

        /// <summary>
        /// 地标类型 
        /// </summary>
        public MarkerEnum Type { get; set; }

        /// <summary>
        /// 如果是待命点，本属性就为待命点分组名称
        /// 名称最好是对应的工序或者子工序
        /// </summary>
        public string Group { get; set; } = "";


        /// <summary>
        /// 对应的机台ID，只有机台类型才有
        /// </summary>
        public string DeviceID { get; set; } = "";
      
    }

    public enum MarkerEnum
    {
        待命 = 1,
        传输机台选择 = 2,
        充电 = 3,
        传输机台 = 4,
        机台前路口 = 5,
    }

    #endregion
}
